<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/jstl/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/jstl/fn.tld" prefix="fn"%>
<%@ taglib uri="/WEB-INF/jstl/spring-form.tld" prefix="form"%>
<%@ taglib uri="/WEB-INF/jstl/spring.tld" prefix="spring"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>">

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>汽车用品之家</title>
<!--标题图标-->
<link rel="shortcut icon" type="image/x-icon"
	href="<%=basePath%>assets/x-img/logo-title.ico" media="screen" />

<link rel="stylesheet" type="text/css"
	href="<%=basePath%>assets/bootstrap/css/resetPro.css">
<link
	href="<%=basePath%>assets/bootstrap/css/bootstrap-combined.min.css"
	rel="stylesheet">
<script type="text/javascript"
	src="<%=basePath%>assets/bootstrap/js/jquery-2.0.0.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>assets/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>assets/bootstrap/js/jquery-ui.js"></script>
<script type="text/javascript"
	src="<%=basePath%>assets/bootstrap/js/jquery.ui.touch-punch.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>assets/bootstrap/js/jquery.htmlClean.js"></script>
<script type="text/javascript"
	src="<%=basePath%>assets/bootstrap/ckeditor/ckeditor.js"></script>
<script type="text/javascript"
	src="<%=basePath%>assets/bootstrap/ckeditor/config.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>assets/bootstrap/Font-Awesome-3.2.1/css/font-awesome.min.css">
<!--这个js有时候会冲突-->
<!--<script type="text/javascript" src="<%=basePath%>bootstrap/js/scripts.js"></script>-->
<link rel="stylesheet"
	href="<%=basePath%>assets/onedate/css/BeatPicker.min.css" />
<script src="<%=basePath%>assets/onedate/js/BeatPicker.min.js"></script>
<script src="<%=basePath%>assets/onedate/documents/js/prism.js"></script>

<style type="text/css">
a:hover {
	text-decoration: none !important;
}

.onedivPro {
	width: 320px;
	margin: 0px auto;
	margin-top: 22px;
}

.onediv {
	margin: 0px 5px;
	display: inline-block;
}

.alldiv {
	width: 100%;
	margin: 0 auto;
	text-align: center;
}

strong {
	margin-right: 10px;
}
a{
cursor:pointer!important;
}
.borderStrong {
	border: 5px solid #dee5e5;
}

.z5 {
	margin: 0 10px;
}

.z6 {
	margin-right: 10px;
}

.changeherodiv {
	padding: 40px;
}

.goodsdiv {
	width: 220px;
	text-align: left;
}

.goodsdiv>img {
	height: 140px;
	margin-bottom: 5px;
}

.zerodiv {
	margin-top: 25px;
}

.keyinput {
	margin-bottom: 0px !important;
}

.item img {
	width: 100%;
}

.left-div {
	position: absolute;
	right: 0px;
	top: 3px;
}
/*轮换图div*/
.rotation-img-div {
	margin-bottom: 60px;
}
/*组div*/
.groupDiv {
	position: relative;
	margin-top: -15px;
}

.groupDiv hr {
	margin-bottom: 30px;
}

.cellFunCls {
	display: block;
	color: #fff;
	font-weight: 700;
	font-size: 25px;
	margin: 8px 0px;
	padding: 5px 10px;
	border-radius: 3px;
	/*background-color: #339BB9;*/
	background-color: #2D6987;
	border-left: 15px solid #D81E06;
}

.cellFunCls:hover {
	color: #fff;
	background-color: #D81E06;
	/*border-left:5px solid #339BB9;*/
	/*background-color: #2D6987;*/
}

.divtip {
	position: absolute;
	left: 0px;
	top: -29px;
}
/*关于div*/
.aboutDiv {
	border-radius: 1px;
	border-top: 2px solid #B3B3B3;
	padding-top: 20px;
	height: 150px;
}
</style>
</head>
<body style="min-height: 660px; cursor: auto;" class="edit">
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<!--引入Top导航-->
				<%@include file="member/shared/pageTop.jsp"%>
			</div>
		</div>
		<div class="row-fluid zerodiv">
			<div class="span12">

				<div class="row-fluid">
					<div class="span12">
						<!-- 显示提示信息 -->
						<%@include file="admin/shared/info.jsp"%>
						<div class="row-fluid ">
							<div class="span12 ">
								<!-- 简单查询 -->
								<form class="text-right " action="<%=basePath%>search"
									method="post">
									<input type="text" id="keys" name="keys" class="keyinput input-large"
										placeholder="搜索...">
									<div class="btn-group pull-right">
										<button class="btn  btn-success " type="submit">
													<span class="icon-search "></span>&nbsp;&nbsp;搜索
										</button>
										<a class="btn dropdown-toggle btn-success " title="精准搜索"
											data-toggle="dropdown" href="#"> <span class="caret"></span>
										</a>
										
										<ul class="dropdown-menu ">
													<li><a   onclick='searchMine("ONLYBRAND");'><span class="icon-search z5"></span>&nbsp;&nbsp;按品牌名搜索</a>
													</li>
													<li><a  onclick='searchMine("ONLYNAME");'><span class="icon-search z5"></span>&nbsp;&nbsp;按商品名搜索</a>
													</li>
													<!-- <li><a href="#"><span class="icon-search z5"></span>&nbsp;&nbsp;按分类名搜索</a>
													</li> -->
												</ul>
									</div>
								</form>

								<!--轮换图-->
								<c:choose>
									<c:when
										test="${(empty topShowList) or (fn:length(topShowList)<1)}">
										<h4 class="text-center text-error">TopShow空缺</h4>
									</c:when>
									<c:otherwise>
										<div class="rotation-img-div">
											<div class="carousel slide" id="carousel-109578">
												<ol class="carousel-indicators">
													<%
														int j = 0;
													%>
													<c:forEach items="${topShowList}" var="topShow">
														<li class="<%if (j == 0) {%>active<%}%>"
															data-slide-to="<%=j%>" data-target="#carousel-109578"></li>
														<%
															j++;
														%>
													</c:forEach>
												</ol>
												<div class="carousel-inner">
													<%
														int i = 0;
													%>
													<c:forEach items="${topShowList}" var="topShow">
														<div class="item <%if (i == 0) {%>active<%}%>">

															<a href=" ${topShow.path}"> <img
																src="<%=basePath%>assets/topshowimg/${topShow.img}"
																alt="${topShow.img}" /></a>
															<div class="carousel-caption">
																<h4>${topShow.title}</h4>
																<p>${topShow.info}</p>
															</div>

														</div>
														<%
															i++;
														%>
													</c:forEach>
												</div>
												<a data-slide="prev" href="#carousel-109578"
													class="left carousel-control">‹</a> <a data-slide="next"
													href="#carousel-109578" class="right carousel-control">›</a>
											</div>
										</div>
									</c:otherwise>
								</c:choose>
								<!--页面主体展示-->
								<div class="alldiv">

									<!--热卖列表-->
									<div class="groupDiv">
										<span class="divtip"> <a class=" cellFunCls" href="<%=basePath%>search?listName=HOT">
												<span class="icon-fire z5"></span>&nbsp;热卖商品 &nbsp;»
										</a>
										</span>
										<hr>

										<c:choose>
											<c:when test="${(empty hotList) or (fn:length(hotList)<1)}">
												<h4 class="text-center text-error">hotList空缺</h4>
											</c:when>
											<c:otherwise>
												<!-- 循环取出商品 -->
												<c:forEach items="${hotList}" var="hotgoods">

													<div class="onediv">
														<div class="hero-unit changeherodiv">
															<div class="goodsdiv">
																<c:choose>
																	<c:when test="${empty hotgoods.img}">
																		<img src="<%=basePath%>assets/goodsimg/404.ico" />
																	</c:when>
																	<c:otherwise>
																		<img
																			src="<%=basePath%>assets/goodsimg/${hotgoods.img}" />
																	</c:otherwise>
																</c:choose>
																<div>
																	<span class="z6">名称</span><span>${hotgoods.name}</span>
																</div>
																<div>
																	<span class="z6">单价</span><span class="z6">${hotgoods.price}</span>(￥)
																</div>
																<button type="button" class="btn btn-success btn-block"
																	onclick="javascript:window.location.href='<%=basePath%>show/${hotgoods.id}';">
																	<span class="  icon-info-sign z5"></span>商品详情
																</button>
																<button type="button" class="btn btn-info btn-block"
																	onclick="javascript:window.location.href='<%=basePath%>cart/add?id=${hotgoods.id}&num=1&sendPage=indexshow';">
																	<span class="icon-shopping-cart  z5"></span>加入购物车
																</button>
															</div>
														</div>
													</div>

												</c:forEach>
											</c:otherwise>
										</c:choose>

									</div>
									<div class="groupDiv">
										<span class="divtip"> <a class=" cellFunCls" href="<%=basePath%>search?listName=LIKE">
												<span class="icon-heart z5"></span>&nbsp;评分最高 &nbsp;»
										</a>
										</span>
										<hr>
										<c:choose>
											<c:when test="${(empty likeList) or (fn:length(likeList)<1)}">
												<h4 class="text-center text-error">likeList空缺</h4>
											</c:when>
											<c:otherwise>
												<!-- 循环取出商品 -->
												<c:forEach items="${likeList}" var="goods">

													<div class="onediv">
														<div class="hero-unit changeherodiv">
															<div class="goodsdiv">
																<c:choose>
																	<c:when test="${empty goods.img}">
																		<img src="<%=basePath%>assets/goodsimg/404.ico" />
																	</c:when>
																	<c:otherwise>
																		<img src="<%=basePath%>assets/goodsimg/${goods.img}" />
																	</c:otherwise>
																</c:choose>
																<div>
																	<span class="z6">名称</span><span>${goods.name}</span>
																</div>
																<div>
																	<span class="z6">单价</span><span class="z6">${goods.price}</span>(￥)
																</div>
																<button type="button" class="btn btn-success btn-block"
																	onclick="javascript:window.location.href='<%=basePath%>show/${goods.id}';">
																	<span class="  icon-info-sign z5"></span>商品详情
																</button>
																<button type="button" class="btn btn-info btn-block"
																	onclick="javascript:window.location.href='<%=basePath%>cart/add?id=${goods.id}&num=1&sendPage=indexshow';">
																	<span class="icon-shopping-cart  z5"></span>加入购物车
																</button>
															</div>
														</div>
													</div>

												</c:forEach>
											</c:otherwise>
										</c:choose>

									</div>

									<div class="groupDiv">
										<span class="divtip"> <a class=" cellFunCls" href="<%=basePath%>search?listName=NEW">
												<span class="icon-time z5"></span>&nbsp;新品上架 &nbsp;»
										</a>
										</span>
										<hr>
										<c:choose>
											<c:when test="${(empty newList) or (fn:length(newList)<1)}">
												<h4 class="text-center text-error">newList空缺</h4>
											</c:when>
											<c:otherwise>
												<!-- 循环取出商品 -->
												<c:forEach items="${newList}" var="goods">

													<div class="onediv">
														<div class="hero-unit changeherodiv">
															<div class="goodsdiv">
																<c:choose>
																	<c:when test="${empty goods.img}">
																		<img src="<%=basePath%>assets/goodsimg/404.ico" />
																	</c:when>
																	<c:otherwise>
																		<img src="<%=basePath%>assets/goodsimg/${goods.img}" />
																	</c:otherwise>
																</c:choose>
																<div>
																	<span class="z6">名称</span><span>${goods.name}</span>
																</div>
																<div>
																	<span class="z6">单价</span><span class="z6">${goods.price}</span>(￥)
																</div>
																<button type="button" class="btn btn-success btn-block"
																	onclick="javascript:window.location.href='<%=basePath%>show/${goods.id}';">
																	<span class="  icon-info-sign z5"></span>商品详情
																</button>
																<button type="button" class="btn btn-info btn-block"
																	onclick="javascript:window.location.href='<%=basePath%>cart/add?id=${goods.id}&num=1&sendPage=indexshow';">
																	<span class="icon-shopping-cart  z5"></span>加入购物车
																</button>
															</div>
														</div>
													</div>

												</c:forEach>
											</c:otherwise>
										</c:choose>
									</div>

									<!--关于-->
									<div class="aboutDiv">
										<h5>
											开发人员: <span title="1314...">李松坚(组长)</span>、 <span
												title="1314...">王小强</span>、 <span title="1314...">田芳</span>、
											<span title="1314...">张奇</span>、 <span title="1314...">贾岩</span>
										</h5>
										<h4>汽车用品销售系统Bete</h4>
										<h4>V0.9.5</h4>
										<h5>
											<a href="<%=basePath%>admin/login">进入管理员后台</a>
										</h5>
									</div>
								</div>

							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	/*自动执行--轮播初始化*/
	$('.carousel').carousel({
		interval : 4000
	});
	 function searchMine(type){
		 var keys=$('#keys').val();
		 window.location.href="<%=basePath%>search?searchType="+type+"&keys="+keys;
	 }
</script>
</html>
